/*-
  use bamp::ApiParser;
  use bamp::CppApiGen;

  my $api = bamp::ApiParser->new("bamp.api", CLASSNAME);
  my $cpp = bamp::CppApiGen->new($api);
  die "API parsing failed" if ${$api}{errors};

  my $class      = CLASSNAME; $class =~ s/::/_/g;
  my $incl_guard = "__".uc($class)."_HPP__";
  my $struct     = lc($class);

  my $shortname  = $struct;
  $shortname =~ s/\w+?_//;

  my $cppclass = $shortname;
  $cppclass =~ s/^(.)/uc($1)/e;
  $cppclass =~ s/_(.)/uc($1)/e;

  my @includes = (
  "bamp/exception.hpp",
  );

  my $parents = join(", ", $cpp->parents());
  $parents = ": $parents" if length($parents);
*/
/*
 * /*= $cpp->header() */
 */

#ifndef /*$incl_guard*/
#define /*$incl_guard*/

/*- for ($api->includes("C++", @includes)) { */
#include </*$_*/>
/*- } */


// Convenience macros that automatically define create() and clone()
// functions in derived classes.
#define /*+uc($class)*/_DEFINE_CLONE(__type) \
    bamp::/*$cppclass*/* clone() const \
    { return new __type(*this); }

#define /*+uc($class)*/_DEFINE_CLONE_NOT_IMPLEMENTED \
    bamp::/*$cppclass*/* clone() const \
    { throw bamp::Exception(BAMP_RC_NOT_IMPLEMENTED); }

namespace bamp
{
    class /*$cppclass*/ /*$parents*/
    {
    public:

        /*$cppclass*/() {};
        virtual ~/*$cppclass*/() {};

        virtual /*$cppclass*/* clone() const = 0;

        /*- for my $m ($api->methods()) { */
        virtual /*+$cpp->declare($m)*/ = 0;
        /*- } */

    };
} // namespace bamp

#endif // /*$incl_guard*/
